<SCRIPT LANGUAGE="JavaScript">  
    function validation()
    {
        var temp="";
        var emailPattern = /^\w+@\w+(\.\w{2,3})+(\.\w{2,3})?$/;


        temp=document.getElementById('EmployerFullName');
        if( temp.value.length ==0 )
        {
            temp.focus();
            temp.style.backgroundColor='#FFC';
            alert('Please provide the name of the contact person');
            temp.style.backgroundColor='#FFF';
            return false;             
        }

        temp=document.getElementById('EmployerCpPhone');
        if( temp.value.length ==0 )
        {
            temp.focus();
            temp.style.backgroundColor='#FFC';
            alert('Please provide phone number of the contact person');
            temp.style.backgroundColor='#FFF';
            return false;             
        }        
        temp=document.getElementById('EmployerCpEmail');
        if( !emailPattern.test(temp.value) )
        {
            temp.focus();
            temp.style.backgroundColor='#FFC';
            alert('Please enter a valid email for contact person');
            temp.style.backgroundColor='#FFF';
            return false;             
        }          
        
    }
    

</SCRIPT>
    


<?php 
echo "<div class='form'>";
    echo "<h2> Edit Acount </h2>";
    echo "<hr color='#2A7EF7'>";
    echo "<div class='kotak2'>"; 
        
        echo $form->create('Employer',array('action'=>'edit_account','onsubmit'=>'return validation();'));
            echo "<input type='hidden' id='email' name='data[oldemail]' value='".$this->data['Employer']['cp_email']."'>";
            echo $form->input('cp_email', array ('label'=>'email', 'maxLength'=>'40','after'=>"<span class='red'><sup>*</sup></span>"));          
            echo "<div class='input'><label for='UserField'>Password</label>"; 
            echo $html->link(__('[ Change Password ]', true), array('action'=>'change_password'));                                 
            echo "</div>";
            echo $form->input('salution', array( 'empty'=>'', 'options'=>array('Mr.'=>'Mr.','Ms.'=>'Ms.','Mrs.'=>'Mrs.','Dr.'=>'Dr.') ) );
            echo $form->input('full_name',array ('maxLength'=>'40','after'=>"<span class='red'><sup>*</sup></span>"));
            echo $form->input('cp_phone',array ('label'=>'Phone Number', 'maxLength'=>'40','after'=>"<span class='red'><sup>*</sup></span>"));
            
            echo "<div class='input'>";
                echo "<label> &nbsp </label> <input type='submit' value='Save'>";
            echo "</div>";
        echo "</form>";
    echo "</div>";
    echo ":. <span class='red'>*</span> Required Field";

echo "</div>";

?>

